package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.Holiday;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

/**
 * <p>
 * 节假日 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2023-08-23
 */
public interface HolidayMapper extends BaseMapper<Holiday> {

    /**
     *
     * @param startDate
     * @param type 1：不排课，2：调课不消耗请假次数
     * @return
     */
    @Select("select count(id) as count from holiday where start_date <= #{startDate} and end_date>= #{startDate} and type =${type}")
    public Integer getIsAt(@Param("startDate") LocalDate startDate,@Param("type") Integer type);
}
